package com.xinbochuang.machine.common.utils;

import java.text.NumberFormat;

/**
 * @author 黄晓鹏
 * @date 2020-09-28 0:13
 */
public class NumUtil {

    /**
     * 数字前面自动补3个零
     *
     * @param number 数字
     * @return 结果t
     */
    public static String getThreeNumber(int number) {
        NumberFormat formatter = NumberFormat.getNumberInstance();
        formatter.setMinimumIntegerDigits(3);
        formatter.setGroupingUsed(false);
        return formatter.format(number);
    }
}
